Fix bug in file loading