Correcting a bug in plot.R