valgrind errors in store unit test fixed