Added directory matching
Added a bit of doc
Protecting against badly encoded files