Re-enabled jshint and changed code to suit it