fix string conversion bugs
add string conversion tests