Hostname handling improved