Corrected some bugs in forms module