add CLI options, minor fixes