Compact output URIs, misc tidy up