Fix malformed paths

(thanks to @OndrejMarsalek)