fixed minor bugs in code found in HTML validator