Support writing objects that are not strings