Fixed the curve selection bug.