Fixed bug in plot code.