Various syntax fixes

Should be self explanatory from the commit messages, any questions give me a bell.