Added debugging to file loading code