Layout. Some important bug fixes.