Updated type attribute.
Fixed a bug.