[Bugfix] fixed problems working with midnight

Wrongly used the DateMidnight class when should have used
LocateDate.now().toLocalDateTime(MIDNIGHT).

Further performed a code cleanup