More PEP8 edits to queries