Fix assertion error in first_of