Fix IndexOutOfBounds for GPIOX scheme