Added check for number of arguments.