Fix index out of bounds on empty response