more fixes on mask import/export