Fixed issue with comparing tags
Misc refactoring in TaggingRepository