Fix setting bugs