Fixed JSLint errors and prettified