This map might be easier to use:
http://upload.wikimedia.org/wikipedia/commons/d/d7/Statecessions.png
http://upload.wikimedia.org/wikipedia/commons/d/d7/Statecessions.png
Okay so perhaps have Maria born as a boy instead after the death of HIS father.
I guess I'll have to scrap the thought of Brazil remaining united with Portugal, from what Ive been reading there wasn't much support for a united monarchy anyways. So perhaps in this ATL Miguel is crowned the Emperor of Brazil, and the young Pedro (OTL Maria) is the heir to the throne of Portugal.
It will be interesting how young Pedro develops, is he a liberal? a moderate? a conservative? hmmm