Some fixes with relations