The problem was that `balance` expected that all node children are set to `KD_NODE_UNSET` by default. However, this might not be the case when `balance` is called more than once. The balance function might change the order of nodes even when no new point has been inserted.