Make testDuplicateFunctions more robust