Fix ordering of relationships