Bug fix to possible infinite loop in extendLineRightFromCandidate