Make path stripping optional

Fixes #664.