You need to hire an attorney, one who works in business litigation (if you can find someone specializing in minority shareholder disputes, that much the better). Right now. If you're delaying on this point out of some idea of wanting to "try to fix things first" or "not wanting to be the bad guy," you're just shooting yourself in the foot and downing blood thinners to keep the wound from clotting. Working with an att…
That last paragraph is gold, OP. Use it to negotiate a clean exit where you are fairly compensated for your contributions.
OP. Just follow it letter-by letter. Make a check-list out of it, if you like. And you probably will be Ok (doesn't necessarily mean that you'll get anything out of it, but it would greatly increase the probability of at least negotiating a clean exit. or at the very least you will know that you've done a good rational move, at least this time around). Do not skip the attorney step. Do not skip the attorney step. (I'm not an attorney myself. I'm just a software developer. And I'm telling you. Do not skip the attorney step).