Pointer out of range fix
Another index fix
Merge remote-tracking branch 'upstream/master'