Moved macro injection before function_name check
Bumped version number to 3.1.1.