Fix JS errors
Merge pull request #151 from juhasch/codefolding

Fix JS errors for 2.x