Fixed bug in dt_destroy_function_data()