Code cleanup according to JSLint