Fix error detection.  (a better fix is coming)