Fix some issues around relationships and tag counts