fix and enhance broken test