Fix bugs in top html scan.