Fixed bug in loading from cache