minor changes and fix empty hostname