fix compile crash, remove some debug code