correcting compilation warnings and cleaning dead code