Corrected number of input arguments checking.