protocol graphs and some bug fixes