Added security check to prevent css-injections
Fixed a few errors spotted by jshint