Fixes stuff pointed out by Liljegren, additional style fixes.