Fixed pin state bug [#9]