Simple cleanups in layout code

r? @SimonSapin or @pcwalton