squashed some path rewriting logic bugs; smoke testing LGTM