Fix so that UI works when using non-standard ports

Probably this fix is broken too, but works for me :-)