cleaning up some JS errors like missing semicolon and so on