Cleaned up some iterator code in edit_scripts.c