Fix tests

@kagemusha for you — fixes a few jshint errors and a couple test failures I noticed