getPort is now non-deterministic so call it just once. Fixes #33