Fixes the binary tree-balancing.