Fix bug in parsing command line settings

wrong Substrings offsets and wrong IF condition made command line settings unusable.