Correct logics of rb tree.