Fix document saving in BCodeEditor