Fix some compile and jshint errors