Fixed some problems found by JSHint