Fix for some folding related issues
Merge pull request #1 from svermeulen/FoldFix

Fix for some folding related issues