Midnight calculation bug fixed.