Fix for #241 (host is undefined)