What I Don’t Get About the AIG Bonuses

Correct me if I’m wrong but aren’t bonuses tied to performance? When your company experiences such massive losses that it needs huge government infusions to keep operating, explain to me how a bonus is justified. Explain why they’re contractually obligated when the business has performed so poorly. It doesn’t make any sense.