Fix get matrices script