final fixes to the script optimizer framework (system working)