Fixing string conversion bug