Fix a couple of bugs in the new html parsing code