Fixed bug where user defined type attribute value of text/javascript didn't get properly serialized.
Fixed bug where space in span elements would removed when the element was considered empty.