Fixed some broken tests by refactoring root checks to use keyname.