small bug fix, fix some tests