Fix metadata unit tests, table to dict function.