Lots of minor syntax fixes etc.