[FIX] don't expect key 'host' to exist

and the other three changes are just for beauty