Fixed bug that only made it impossible to query after the first query. Derived from trying to fix antoher bug, but that fix attempt removed now.