Fix rat.
Fix problems with file locations in the file helper. Add tests.