Minor changes to relations to get it working correctly.