Fix spawn with invalid refs.