Adjust format to fit with default VS 2013 rules

VS 2013 appears to have built-in formatting for C++, so this commit tidies
up the code a bit to fit within those rules.

It also removes a few warnings which the new compiler has shown.