Fix structure iteration algorithm; works with a 2.6 system