Fixed bug that caused a server crash when document does not contain tags that can be used for script insertion.