fixed bugs in fifo and gpio