Fixed bug in plot error