improve documentation
add test for 277
defend against rare null ref when 3rd party libs mess w/ dom