The idea that mutations are always harmful can be trivially demonstrated to be false. Several types of antibiotic resistance in bacteria are due to mutations in the the DNA coding for proteins attacked by the antibiotic in question. These mutations may have arisen millions of years ago, or they may be novel. As noted by sdanic, gene duplication makes this a lot easier - an organism can now allow mutation on one copy of the gene while not suffering any ill-effects if it all goes pear shaped. As an interesting aside, bacteria will often undergo higher rates of mutation while stressed for some reason (being poisoned, starving, similar things), presumably because this increses the chance that they'll come up with something that can get them out of their current predicament. Mutation allows for evolution.