Fix out of index crash.