Is the Church a flawed structure?

With St. Peter as the foundation of the Church, does that make the Church inherently flawed?
NUK