fixing problems decrementing references to items in lists and dicts