Add diagnostics for mesh consistency