Fix cache clearing in get_list_and_clear()