change tmpdir to datadir (fixes #198)