fixes, mainly to diagnostics