Some minor improvements to plotting functions