Fixes to plot masking.