Fixes #133

I tested it with all the path forms I could imagine, and it seems to work well.