Fix error messages handling.