Fix some format specifier and mismatched type warnings

This fixes a few small warnings that appear when building with GCC 4.8.1.