General improvements after running through jshint