Also include a test and fix to createUri that bails if the host is empty #560.