Fix test giving sporadic problems