NodeStore: Fix a minor memleak, add aditional g_assert checks.