Fixed undefined variables if HTTP request errored.