fixed avl tree last retrieval bug

Retrieving the last element from an AVL tree would grab left nodes instead of
right.