Fix issues

This fixes a couple of issues introduced in fa2d8593c0921c84ba04e7d30bc252d9ea33a3d9:
1. An exception is thrown when a document type is saved
2. DataTypes are no longer saving to XML on save