a few bug fixes to get the gpio interface to work