Fix issue with master server hostname retrieval