Javascript syntactical fixes