Fix error detection and response