General tidy up: dropped various unused variables, leftover code, added missing semicolons, etc
Merge pull request #367 from pimterry/tidyup

General tidy up: dropped various unused variables, leftover code, fixed spelling, missing semicolons, etc