A bunch of coersions, fmt changes, type long to int (which eliminated
a long-standing warning from MSVC in 32-bit mode). I don't know why
some of these warnings just showed up now (maybe Michael's cygwin
compiler invocation change?), but good to have them.