Fix bug in finding mask file name.