Fix script_level ordering bug when stages are renamed in script