7f9848db99
No clue why it ever gets a -1 index though.
(cherry picked from commit b12c7cf9633a9fc3a728a0ef44b5d50d621a7595)
(cherry picked from commit e9083fc571)