Fixed bugs with layout