updated test.c and gpio.c for bug fixes