Include port numbers when assembling URLs

Per #275.