Adds debug logging to control graph builder, fixes bugs

Issue: #32