More fixes to metadata writers, which had slipped through some cracks.