More safely build filenames

This avoids an error I was getting while parsing
http://localhost:8095/foo

`invalid value for Integer(): ":"`
Merge pull request #80 from jeaye/master

More safely build filenames