Merge pull request #346 from belkiss/development Fix memory leak when wrong object type is looked up from cache