fixed a memory management issue affecting mutual recursion