Fixed minor issue with generated relations