Scripttemplate: big cleanup.