Input validation of function arguments.