Fixing graph clearing