Fix bug where selector matches root node