Changed string conversion to (hopefully) eliminate some bugs.