Fixed some things related to relations