2 of 3 Tidied up sentence structure, some grammar changes

Is Elizabeth and Will's marriage legitimate?

During the climax of Pirates of the Carribbean: At World's End, Will and Elizabeth are married onboard The Black Pearl. The fact is Barbossa's first mutiny should have prevented him to be the "real" captain of the Pearl, but putting this aside I'm fairly sure that when Jack's right in the next ship fighting Jones, Barbossa couldn't be the offical captain of the Pearl. Therefore he shouldn't have the power to perform any marriage ceremony.

What I concluded from this is that their marriage may be in fact unofficial according to the maritime law, making that whole scene pointless. Even if they knew this, it would still disturb me that they consider Barbossa to be the real captain of the Pearl just because it serves them better at that moment. Either way this is one unnecessary plothole. Are they actually married?