Fixes error with file open mode.