Fixed bug in file open.