fixing traversal error in non adjacent selectors and in return type of previousElementSibling and friends