Change mask definition and test invalid inputs