Fix behavior on major layout changes