Added checking for cyclic inheritance and negative tests