Test toString and toJSON