fix last "valid script" test
improve script verification