Add error weighting and automatic mask generation if errors are supplied