Fix sporadically failing test