Check arguments to prevent illegal ones.