Better type section processing (fix  #7)