Various fixes to layout events and forms.