Fix error in purge_removed().

Iterator was looking into uninitialized memory inside the
advance_to_next_item_of_right_type() function.

Should fix #47.