Fix loading of mode, and add some (untested) setting functions