Added removal of unvalid relations after abstraction