JSLint compliant code

JSLint compliant syntax and minor code revisions.