Fix a couple of queries