Detect circular inheritance (fix #57)