Fixed to comply with JSHint and JSLint suggestions