[FIX] models: revert changes in yaml_import, and make _onchange_spec() more robust