Fix automatic downward directed graph constraint generation

Quick and dirty fix attempt for #14.