Bug fixes

Fixed several bugs in the set_pin_pullup and set_pin_direction functions
which were causing them to set incorrect values.