Check size of file to load.
Minor refactoring.