fixed possible crash related to masks in nested mode.