Fixes for expansion of hostnames with - in them