Fix a bug in string parsing
Make CLI bulletproof