Check and fix compile warnings