BUG: Fixed issues with metadata while indexing

- Fixes #281