Limit cache size to a petabyte so that we can test the code path where an impossibly large cache size is inserted. Fix a bug revealed by this test.