Flex fixes and layout improvements.
Full use of flex in layout 2.