Fixed another race condition that could freeze the UI at startup if loading a very large file.