Fixed object to string safe conv segfault
Added __toString() class test case for typehints