Add error checking when parsing string
code compiled and tested on Folpo - tag 1.0.1
based on CVS release_06