updated for version 7.0021
diff --git a/src/fold.c b/src/fold.c
index 1aee87c..bb268fb 100644
--- a/src/fold.c
+++ b/src/fold.c
@@ -902,6 +902,8 @@
     int		level;
     int		last;
 
+    checkupdate(curwin);
+
     /* Repeat "count" times. */
     for (n = 0; n < count; ++n)
     {
@@ -2883,7 +2885,7 @@
 	{
 	    /* Found an entry below top. */
 	    fold_changed = TRUE;
-	    if (fp->fd_top + fp->fd_len > bot)
+	    if (fp->fd_top + fp->fd_len - 1 > bot)
 	    {
 		/* 5: Make fold that includes bot start below bot. */
 		foldMarkAdjustRecurse(&fp->fd_nested,