Fix removing items from graph

The new method is more Pythonic and works.