fix count_trailing_zero