fixes to tag querying