Minor tweaks to hostname handling

Signed-off-by: Ozan Turgut <ozanturgut@gmail.com>