Fix metadata unit tests