Cleaned up code in edit_scripts.c