fix wrong test and fix nondeterministic test