Fixed a warning and printing garbage