Improved heritage end detection.