Better diagnostics.
Mining bug fix.