fix some bugs with string parser