Fix byteorder in debug output.
Clean up GPIO code.