Finalizing binary trees