Fixed merge conflict and undefined var in layout.tpl