Fixed wrong number of input args check at end of code