Fixed bug in groups when night_time is smaller than day_time