cleaning up html tag mismatches and other minor bugs