Improve error recovery