Improved overal error handling.