Reset hash when leaving add tree mode, Fixes #328