Necessary changes to fix bugs in the declaration caching mechanism, in relation to the IDE use cases