Fix erroneous error handling.