First of all, humans are not perfect. The only being that is "perfect" is Allah (swt). He is without fault, or err and that's basically the end of that discussion.
And for those "unnecessary body parts", how do you know that they're actually unnecessary? Not to long ago, the human spleen was thought to be a vestigial (without function, in other words) organ but now an overwhelming amount of evidence soundly debunks that claim. The same with the human appendix, which we now know plays a role in the immune system.