Scoutscript fixes and cleanups