Cleaned up layout-driven output stuff and a few other things.