fix for NPE in query engine, org. structure queries.