read hostname; other fixes