Ran JSLint - added a few missing semicolons and changed != to !==