Added remaining queries, fixed some typebugs in agents