SCI-637: Fixes to metadata saving