caught errors when q is supplied, minor fixes