Make initialization of autoid more reliable