Fixes a bug with the existing plot function. This will be replaced with new functionality soon