Better error handling on invalid arguments.