Fix issue where Q not properly formed when answer was array

* Still needs fixing: using Q to find applications satisfying
  multiple constraints using different AEs