Fixed remaining_time calculations.