Added optional type attribute.