Many more fixes to layout and samples