Fixed path analysis

Fixes #1979