Add avl tests

This pull request adds and fixes the avl tests
Why storing the element here, if not checking for a `NULL` ptr return?