set_mode fix: cleanup