fixes #327: more explicit string format specifiers and casts for 64-bit