Added handling for uninitialized trees, improved predecessor/successor functions