Fix issues in LRU encoding