Added test for querying references