Fix bug on graphs with only one indicator(whether this make sense or not); Reorganizing code.