check_layout function

Check that layout and mode are correct