Multiple layout support. Closes #1322