Patches to mode setting