Fix thinko in local error management and add some comments.