Fix fragile tests