Allow direct calls to toJSON()