Improving dom methods and test cases.