Fix minor bugs with removing graphs