Replaced use of global gFile with the local file.