Fixed missing semi-colons and malformed if statements

Still two errors, left errors from www.javascriptlint.com error checker as comments, hope this helps <3