fixed a nasty time math bug

I have no idea how this regression happened.