URL generation fixes