fixed clock running too fast on ATmega168p/ATmega328p

The original Code selects a PWM mode instead of CTC, which causes the system clock to run too fast.
I suggest to combine the first to operations into one:
{TCCR1A&=~(_BV(WGM10)|_BV(WGM11));TCCR1B|=_BV(WGM12);}
and what about WGM13?