FunctionManager: fixed creation of a function in the wrong category