check_args function

Check argument types, length, or dimension