Resurrect TMPDIR on JVM. Added spectests.