Fix SHAMap::canonicalize, improve flushDirty
It could return a node with the same data but a different ID