Fixes small memory leak case and print function name properly