Clean up syntax and jshint warnings