Fixes log string formats and casts for 32 and 64bit

A few formats and casts where inconsistent and raised warnings when compiled with 32 and 64bit.