Added some checks to see what the root object of therepository is.