Fixed issues with custom fields in modal dialogs