fix problems reported by JSHint