Fixed a dynamic memory allocation problem in the root writer.
Merge branch 'mws-dev'