As chief of Middle East affairs for the Foreign Ministry , he helped organize the 1991 Middle East peace conference between Israel and the Palestinians in Madrid , dealing with such issues as where the flags would be placed and the shape of the table .