Attempt to fix the problems of sessions timing out and left-over locks