The evolution of ineffective and harmful medical treatments