Improve error message for unexpected condition.