Fixed a bug where all tags were inserted as scripts regardless of type.