Fix bugs in presence memory store
Unit test of presence memory store