Fixed ending time as well (behaviour was different but corner case was the same: when start ou end times were exact multiples of step)