Moved another argument validation up to the high-level C API.