Fix compilation issues with the programs

Unused variables, incorrect printf format, char array usage
 etc.