Add debug, debugMessage settings for createFunction