Fixed NullReferenceException on creating new Repository.