ensure that identifiers and references are handled when waking up
Merge pull request #282 from doctrine/metadata_cache_fixing

Metadata cache fixing