Fix out of bounds access.