remove trailing whitespace, fix two jshint warnings