Improved error reporting.

fixes #2
Changed escaping in filename regex.

fixes #3