Fix cp28386.

Add additional checks of the passed in mode.