Fixed bug in plot()