Fix unit autocalculation