Fix precision losses during conversions