Make sure new MAT files are used during restart
Fixed bug on Python3 when using an unnamed TempFile