More layout fixes for issue 1021