Fix some URL generation "quirks"