Fixes on BinTreeNodeWriter and uses of KeyStream