With help of Oleg I found, that line "*left = *right = FirstOffsetNumber;" was needed only for 7.X compatibility, and it isn't needed any more.
Also, I've replaced "i - 1" by "i - FirstOffsetNumber" in array filling. I believe it's more correct way, because it'll work correctly in the case when FirstOffsetNumber alters.
----
With best regards,
Alexander Korotkov.