Fixed path generation, fixes #1