MODE-2297 Corrected getNodes() functionality

Changed the tests to always check the query via rows and, if there's only one selector in the query, also by nodes. Fix a problem when getting the nodes on some queries.
Merge pull request #1254 from rhauch/mode-2297

MODE-2297 Corrected getNodes() functionality