Corrected using JSLint