tm: fix fr_inv_timeout bug from commit d244686dc5f

	* also improve code readability with a couple of macros
(cherry picked from commit 2535935327f30a2c004c3f2619c1cc9f0ed0e26c)