some tests, bugfixes for sorted_set implementation