Implement encodeWithCoder to pass test.