Fixed IndexOUtOfBoundException.