Improved error recovery