Bug fixes in dom find function.