Fix handling of query results to regain saving login status