Added more comprehensive check for the time interval. Intervals that include midnight are now possible. Closes #16