Fixed most compile warnings