Minor fixes to tags, refactoring.