Handling empty boxes, and midnight properly