added more diagnostics.