Fixed up the bugs with metaquery.