Fixes for reading type attribute.