Fix toJSON problem.