Fix traceback with missing hostname key