Fixing bug in file()