Fix bug in calculating time interval hours