jshint pass
Fix bugs