what it needs is someone who understands the rules and applies them as written, so that when questioned after the event they can say "the rules say..." and justify their decision based on the rules.
Making up a rule and justifying it with "but the teams wanted to end under green flag", just isn't that.
Masi needs to go, but the FIA need to change the way teams communicate with the race director. IMHO, the pressure applied to Masi through the season by team principles was unacceptable. That needs to change.
Who do you replace him with? well it needs to be someone intimate with F1 and its rule book, so it is always going to be someone with a former team allegiance or friends in the sport. Or maybe it needs to be someone from outside the sport who is smart enough to read the rules, and brave enough to apply them. I am available!