address some metadata hashtree issues

fixes #389 #390 #391. see issues+commits for more details