URL generation bugfixes