Fix and add tests for interval.