Argparse/Optparse support and minor tweaks