resize() handling and layout improvements.