Fixed bug in bodyIndex finding