fixed several issues with recursive document schema creation