Fix a mask reader bug