Fixed bug in fold.