Fix bug in String encoding