Minor bug fixes for HeapCache. Unit test is added for HeapCache.
Minor bug fixes for CacheTransaction and tests are added to
TransactionalHeapCache.