Exposes host as option and fixes problem with wrong error handling