Fix 64-bit conversion errors