[Memory management] Handle invalid arguments.