Fixed problem with calculation of occupancy from EI when the end of the time range is unoccupied