Bug fix for createPath()