script_flow bugfixes