End of interval bug fixed