Fixed code raising warinngs in g++