Fixes the wrong midnight epoch bug