Fixed UI bugs with layout, handlers