Fix the check for ui_mode, wasn't doing the right thing when defaulting.