Fixed custom generation recursion