Fixed bugs in form.