fix compile warnings/errors