Avoid NPE when backing up metadata if there is no metadata
Do not use null transaction in tests