add fix to rebuildCache method and add ListOf and SortedListOf wrapper