Improve error recovery in get_label().