Bugfix with changing layouts, undefined variable.