various fixes for input graph building