* Fix incorrect format strings and uninitialized variables. * Address comments * Add the missing include statement