Fix array index out of bounds in tweet retrieval