Fixed some type 4 error handling logic.