Fix wrong compilation context variable in create_instance optimizer