Fix bug in layout reference