analogWrite() has to be disabled before the pin can get another I/O function:

There is a problem with analogWrite() using at the SAMD21, see here:
http://www.avdweb.nl/arduino/samd21/zero.html#h11-how-to-use-pwm

Before we can change the pinfunction we have to do:
analogWrite(nr, 0);
I think this is a bug, can this be solved?