Corrected argument validation.

The program will no longer accept more than the required number of input arguments. The validateArguments(...) function has been amended to check that the exact number of arguments has been provided.