Fixed zero pointer dereferencing, and comment.
Added the curve set user function.