Pull visit_reason with visit_query.
Misc. tiny changes due to package rules changing.