Shrink size of dialog, improve validation code