Better TF activation detection

Fixes #144