several fixes in the dom patcher