Fixed bug reported by JSHint