Simplify test.
Fix code on older go version.