[liuxia] Fix issue found by Wang Tao. #1, #2, #3
merge test cases with master branch