Fixed balancing bug, leading to inconsistency in the heap.