Fixed broken test by using tmp directory