Don't crash when path is not a String

Circumvent a problem where someone makes a requests so that we cannot rely on path being a String.