Fix getLongestDelta bug reported by lmctruck