Ensure hostnames are set properly. 

Should fix #712