Improve error message for invalid drawing commands.