Syntax fixes in Javascript