Bug fix and refactoring. See: https://github.com/websharks/html-compressor/issues/45