Fixed bug in error recovery.