Fixes #206 and #207.

Prevents clashing if multiple TGM libraries are active at one time with
a proper function check.