If the ending was that the kids were actually adopted and Barney and Ted got married instead, it would still be a better ending than the original.