Fixed some bugs with buttons, also extended the LayoutEngine