Some tweaks to file loading