Fixed sources of possible exceptions in string parser routines