Fixed parsing issues in parse_options function