Fixed BTree.finish() so that it now writes all nodes still in the cache
to disk