Reworked several interfaces, mostly related to metadata, and fixed some problems created during refactoring.