Fixed memory leak in DocumentTypeBuilder