Merge categories (tags) by slug

For issue #603
fix errors from #601 and #594 here too, sorry