Fixed several off-by-one errors in BTree.java