SetKSScript and XXProtect commands

as well as bug fixes