improve patch diagnostics