Fix a bug on masking position and size.