I honestly think that the solution to this is abandoning corporation tax. I know this will be unpopular, but hear me out.
Forget corp tax. Forget calculations of profit. Any money made by a company is untaxed as long as it remains in the company. If it is re-invested, or even held as cash, it is untouched.
As soon as it comes out of the company, the individual is taxed. This would be full income tax on everything: Wages, dividends, interest etc. While we are at it, roll up NI into income tax. It is, in effect, one and the same, a tax on income. It is much simpler to administer, too, and it encourages investment. The money will be taxed, eventually, when it leaves the company.
This would also help clamp down on those who set up a company, take minimum wage and then the rest as deividends. Those dividends get added to their income and taxed at normal rates.