bug fixes. XinZhan fixed.