Made changes according to JS Lint