Fixed testing code that determines which functions are needed