Fix tests interacting with the filesystem