Don't segfault on "layout number" when not on a layout (thanks Soliton)