Adds fixes for layout thrashing