Fixes DOM traversal