Fix build break around iterator_traist. Make sure that the right header is
included, and use typname where it is needed.