Added missing `var`s and semi-colons.

Removed extra semicolons after `if` statements.