Fix error due to missing mask_stacks assignment.