File loading fixes