Fix type in to_object doc string