Class hierarchy bug fixed, now accurately detects circular hierarchy