Improved handling of failures.