fixed small bug, including testcase