Fixing an HTML generation problem