Add tests for Store getIdentity and _setIdentity and fix related bug