Compile on modern gcc, fix format string warnings