Another bug in curve detection fixed.