Fixed code style and jshint warnings