Fixing broken tempfile

Some tests are still broken, but then the lib compiles.