minor bug fixes to plot.py