Changed printf-style functionality to understand %v for printing values.

[#59747800]
Fixed memory leak.