cleanup
fix #1337 bad interaction of removeFolds and updateWrapData
fix test
Merge pull request #1340 from ajaxorg/wrap_bug

fix #1337