Fixed errors based on jshint results