Fixed Bugs in HTML table generator