queryz: fix wrapping and add Reason to output