Convert `writeJSON` argument to object.

See #138.