Fixed bugs with layout changes