Replaced duplicated function argument checks with arg_check() function.