Fix interval calculate.