Fixed metadata integration tests for index manipulation.  DB was not correctly managed and metadata was missing bits