Cleaned some code according to JSHint