Fixed bug in relationship builder