Sanitise input arguments.