Improve how has_tostring works