Return correct ID for each term_id

Fixes #3
Merge pull request #8 from mweimerskirch/patch-1

Return correct ID for each term_id. Props @mweimerskirch