guard against recursive data structures in pruneFunctions. fixes #14