fix several init problems