Revert "Use child number instead of left/right"

This prevents a bug where the 1st child is inserted before the 0th.

This reverts commit a7ddfa59774e1be6055805fb88dabdf1fe06e7c0.
Bug fix