Updated MathExpression to handle all exceptions.
Fixed bugs in _parse_string_len.