Improved timeout behavior and error reporting.