Throw errors for queries that are not in the order we expect