Fix delete_by_query