Cleaning up warnings and tidying XML.
Fixing issue #328.