fix #211 bugs with test case