Fixed bugs, added test layout to flake.