Deal with undef layouts