Used ConvertTo instead of casts for string conversion.
Added tests for conversion to string.