Fix assertion failure in first_of