querypt test; fix ref error when grandchild nodes created