Use correct file open mode