Prevented memleak
Added function and its argument dumping