Raised the graph-has-cycles error.
Used a local var for str.
Required qtsvg only when needed.
Merge pull request #3 from fidlej/topic_error_early

Minor improvements