Fixed some bugs in relation display