Improved adding custom quest functions (fixed crashes) (closes #14)