Path and conflict related fixes
This MR brings various mostly path and/or conflict-related fixes, which I found when I was learning extractor internals. I will file soon also a bunch of issues for other bugs I found, which I haven't fixed. See commit descriptions for more details.