Fix numerous compiler warnings and format conversion specifiers.