Bug fixes

Prevents inclusion of categories without parents in the categories
parents loop and remove dupes before imploding.