Pointer out of range fix
Another index fix