Improve Memento handling.
Fix error in memento export.
Merge remote-tracking branch 'origin/master'