Fix rendering issues when adding a block above a layout. #426