Fix some bugs about namespace