Catch any exception raised by load_file
Add tests
PEP8