Fix layout definition not being overwritten in some cases