Looking at the uses of MCS_open - it would probably be better to change the signature of it so that it takes an enum rather than a string for the mode (see email).