fix compile error & warnings