Fixed bugs in form editor