Fix up URI generation