Actually fixed the IndexOutOfBoundsException this time.