Bugfix for IndexOutOfRange.