Fix incorrect rounding due to missing cast