Fix handling of script and style blocks.