Fix 64-bit precision loss issue