fix up iterator syntax and unnecessary use of X_() in NSM patch