Fixed handling of previous data query results