Fixed double closing of self calling function.