option parsing, minor fixes