Fixing some bugs in my last commit

Fixing some bugs in my last commit

There's an important lesson here, kids!  In filing your new
performance improvements, don't forget to test for correctness as well
as speed improvements!

I had both off-by-one errors and a failure to assign my temporary
record back to the original array.  Yeesh!  This brings the
performance closer to our current fastest versions (i.e., I revoke my
claim to now have the fastest version -- though I should be right in
there with them).

git-svn-id: 88467cb1fb04b8a755be7e1ee1026be4190196ef@21690 3a8e244f-b0f2-452b-bcba-4c88e055c3ca