Fixed clicking behaviour in graphs

This is related to item 5 in #46.