Fix a bug in chooseEdgeLengthAndCurvature()