Fix unit type conversion