Fixed issues with the forms throwing a jquery exception when closed
using the dialog's x button.