Fixed file open mode to address raw writes error