[liuxia] Fix issue found by Wang Tao. #1, #2, #3
[liuxia] Fix issue reported by Chen Bojian #4
[cbj] merge with lxconan & passed all tests