Fix command-line options, and connect the reinit function to the Agent;