Fixed bug with cache dir, cleaning up