Updated to have tests write to tmpdir (Travis!)