Cleaned up PlotDialog and fixed issue with plotting the last section