Fixed bugs for Binary Pointer Tree