code style
fix error when inserting text inside code
minor fixes
Merge pull request #2088 from ajaxorg/misc

Code cleanup + minor fixes