Fix iteration on empty RB tree, add test