Added: flushToDisk, more diagnostic output.
Changed: diagnostics is not errors.
Fixed: too late flush.
Merge remote-tracking branch 'upstream/dev' into dev