Minor changes to support masking