Fix write bug

Stefan Schuhbaeck requested to merge fix_write_bug into master

Merge request reports