Fix closing file and add scrubbing the client table in case of machine failure