Various initialization fixes