Fix regression with end of HTML
- Also remove debug statements