Fixed namespace imports

Use `InvalidArgumentException` to avoid namespace issues.