Fix for 'invalid dimensions for plot' error.