Fix test to be less brittle