Fixed a bug with plots