Fix error when loading an embedded layout.