Fixed support for self-closing script tags.

Fixes #305