Fixed a bug in plot