repaired major bugs in relations