Build fixes for MSVC 12 (a.k.a. MSVS 2013) compiler.

Most of those are self-explanatory, except for the last one. It took me quite some time to convince myself that this code really wasn't needed, but it definitely seems so, finally. Hopefully the commit message explains why.