fix scriptmode+debug+resume