Sort args beforde passing them to the replacement function.