Fix reference iteration mask