Fixing path rewriting

Shatilo fixed it