Fixed typo in savePlot function