Fixed a problem with incorrectly setting the register for pin operation.