several patches for domdiffing