to_string and type fixes