Fix bug in layout resizes