Fix problem with don't cleaning removeFunctions after tear down