masks-related fixes