Added diagnostics for expect