Fix the over midnight ID rollover calculation