Bugfix: correctly terminate layouting