test for commas in selectors; fix bug where root element would be returned even if child matches existed