Fix invalid query result when key not present.