Curve will not confine to model surfaces

Thank you; I think I have figured out the trigger. The unexpected behaiour (crashing upon hitting undo on an open curve) started after I added the Undo/Redo button following this link, and later I tried the code snippet suggested by this post, which I suspect further broked the open curve function somehow, crashing every time I try to adjust a control point on the curve, even when I reverse back the first version of the Undo/Redo code snippet.
I have since then removed all code snippets in ‘.slicerrc’, and no more unexpected crashing so far.