Form: Remove useless variables and bug fix