Fix: deal with getHostname() returning different results on different platforms