Fixed duplicate root keys fixes #521