Miscellaneous cleanup stuff

General tidying of spacing, adding of semicolons and using more explicit equality operators.

Most of it is just my being somewhat anally retentive so let me know if some of it is over the top