Possible fix for writing resumedata + more debug info