Cleanup and terminate interval properly.