More work on metadata handling