Fixed bug where the same nodes were being queried.