Change to_string implementation to compile on cluster