Explicit casts to proper integer types when formatting