Minor improvements and bugfixes to binary pointer tree.