Reworked the HTML extraction code + added tests for specific client bugs