Added tests, fixed bug with cache clearing in size-restricted package cache