[BUGFIX] Harden layout selector against errors in templates
Merge pull request #59 from NamelessCoder/missingtemplate

[BUGFIX] Harden layout selector against errors in templates