A flawed but credible election