Remove redundant code.
Fix unstable test.