Fixed an issue with the removal of a graph panel that is selected for another file (closes #315).