Added some fixes to string parsing logic.