Generated relations are now properly sorted