Changed tests temp dir and fixed Packages#write.