More file checks and optimizations.