Fix adding and removing graphs