fix missing break
fix some jshint warnings