fix error reporting for masks