I don't entirely agree with Megan's position.
Given that most people (and, apparently, all bureaucrats) see the terms 'sex' and 'gender' as synonyms, perhaps this change won't cause any problems. Only time (and the courts) will tell.
It seems to me that the best way to define marriage is "a voluntary union between any two consenting adults."