Reset the parameters each run

Change-Id: I7001f7b18c7c8bad046c85b6f45af2e265a30f53
Add logging of errors, close sessions

Change-Id: Id60865a95fd143e5c07f330b1143931181b0af04