Better handling of set_level