Fixed some errors in the relation class