Fixed incorrect variable names of command line parameters.

This is just a minor issue. The order of parameters in the main function is backward at some places. It should look like the following:

    int main(int argc, char **argv)