I Made Myself An AI: Small patch for September 16

Fixed undo Undo was crashing the game because I miscounted an index, it should work in all circumstances again.